<template>
  <div>
    <ul>
      <li v-for="(item, index) in newsArray" :key="index">
        {{item.title}}
      </li>
    </ul>
  </div>
</template>

<script>
  export default {
    name: "news",
    data(){
      return {
        newsArray: []
      }
    },
    mounted: function () {
      var news = [
        {
          id: 1,
          title: '新闻1'
        },
        {
          id: 2,
          title: '新闻2'
        },
        {
          id: 3,
          title: '新闻3'
        },
        {
          id: 4,
          title: '新闻4'
        }
      ]
      this.newsArray = news
    }
  }
</script>

<style scoped>

</style>
